#include<iostream>
using namespace std;
const int N = 110;
int f[N];
int n, m;
int main()
{
	cin >> n >> m;
	for (int i = 1;i <= m;i++)
	{
		int l = 0, r = 0;
		cin >> l >> r;
		f[l] += 1;f[r + 1] -= 1;
	}
	for (int i = 1;i <= n;i++)
	{
		//还原
		f[i] += f[i - 1];
		if (f[i] != 1)
		{
			cout << i << " " << f[i]<<endl;
			return 0;
		}
	}
	cout << "OK" << endl;
	return 0;
}